<?php

class m131116_071901_oak extends CDbMigration
{
    public function safeUp()
    {
        $sql = 'CREATE TABLE `{{city}}`
                (
                    `id` smallint PRIMARY KEY,
                    `name` varchar(255),
                    `latitude` float,
                    `longitude` float,
                    `country` char(2),
                    `country_name` varchar(255),
                    `created_at` datetime,
                    `updated_at` datetime,

                    INDEX idx_country (`country`)
                )
                ENGINE=InnoDB DEFAULT CHARSET=utf8;';

        $this->execute($sql);
    }

    public function safeDown()
    {
        return false;
    }
}